import { createRouter, createWebHistory } from 'vue-router'
import login from '../views/log_reg_view/login.vue'
import register from '../views/log_reg_view/register.vue'
import dsindex from '../views/dscompany/index.vue'
import event from '../views/dscompany/event.vue'
import productview from '../views/dscompany/productview.vue'
import about_company from '../views/dscompany/about_company.vue'
import sale_service from '../views/dscompany/sale_service.vue'
import cooperate from '../views/dscompany/cooperate.vue'
import routerindex from '../views/dscompany/routerindex.vue'
import productForm from '../views/dscompany/productForm.vue'
const routes = [
  {
    path: '/',
    redirect: 'navigation'
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/register',
    name: 'register',
    component: register
  },
  {
    path: '/navigation',
    name: '首页',
    icon: '',
    show: true,
    component: routerindex,
    redirect: '/dscompany/index',
    children:[
      {
        path: '/dscompany/index',
        name: 'dsindex',
        component: dsindex
      },
      {
        path: '/dscompany/index/event',
        name: 'event',
        component: event
      },
      {
        path: '/dscompany/productview',
        name: 'productview',
        component: productview
      },
      {
        path: '/dscompany/about_company',
        name: 'about_company',
        component: about_company
      },
      {
        path: '/dscompany/sale_service',
        name: 'sale_service',
        component: sale_service
      },
      {
        path: '/dscompany/cooperate',
        name: 'cooperate',
        component: cooperate
      },
      {
        path: '/dscompany/productForm',
        name: 'productForm',
        component: productForm
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
